package com.zjy.spts.util;

import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Properties;

/**
 * Created by zjy629 on 2018/4/17.
 * JSON返回数据读取
 */
public class JSONUtil {
    private String message;
    private String messCode;
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getMessCode() {
        return messCode;
    }

    public void setMessCode(String messCode) {
        this.messCode = messCode;
    }

    /**
     * 读取common.properties中的数据
     * @param ms
     * @return
     */
    public  String  messages(String ms){
        Properties properties = new Properties();
        String j ="";
        try {
            properties.load(new InputStreamReader(JSONUtil.class.getClassLoader().getResourceAsStream("common.properties"),"UTF-8"));
            j =  properties.getProperty(ms).toString();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return j;
    }


}
